<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>

</body>
<script>
//es6,旧数组生成新数组map
let currentYear = new Date().getFullYear()
// 本质 什么样的转换 什么样的数据  旧数组-> 新数组
// let l = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14]
// let yearList = l.map((t, i) => {
//   return currentYear +i-5
// })
// console.log(yearList);
// let l = Array.from(length :11)
let l = Array.from(Array(11))
// let yearList = l.map((t, i)=> {
//   return currentYear+i-5
// })
// 写法的简化
let yearList = Array.from(Array(11),(t, i)=> currentYear+i-5)
console.log(yearList);

</script>
</html>
